package TestDemo3;

class Math{

    public void math() {
        System.out.println("数字");
    }
}
class One extends  Math{

    public void math() {
        System.out.println("1");
    }
}
class Two extends  Math{

    public void math() {
        System.out.println("2");
    }
}
class Fore extends Math{
    @Override
    public void math() {
        System.out.println("4");
    }
}
class Three extends Math{

    public void math() {
        System.out.println("3");
    }
}

public class Test1 {
    public static void drawShapes() {
        Math[] shapes = {new One(),new Two(),new One(),new Two(),new Three()};
        for (Math shape : shapes) {
            shape.math();
        }
    }
    public static void main1(String[] args) {
      drawShapes();
    }
}
